<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="../common.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>角色修改</title>
    <script type="text/javascript">
    
   		var roleId = "";
   		
    	$().ready(function(){
    		
    		var map = Dialog.getInstance("view").getParam("param");
    		if(map != null)
    		{
    			Form.bindForm("winForm",map);
    			roleId = map['id'];
    		}
    	});
    	
    	
    	function doSave()
    	{
    		if(doCheck())
    		{
    			var map = Form.formToBean("winForm");
        		map.id = roleId;
        		ajax.remoteCall("com.system.dao.RoleDao:update",[map],function(reply){
        			var result = reply.getResult();
        			alert(result.value);
        			if(result.type == "success")
        			{
        				var dlg = Dialog.getInstance("view");
        	    		dlg.getParam("window").mygrid.reload();
        	    		dlg.close();
        			}
        		});
    		}
    	}
    	
    	function doCheck()
    	{
    		if($.trim($("#name").val()) == "")
    		{
    			alert("角色名称不能为空");
    			return false;
    		}
    		
    		return true;
    	}
    </script>
  </head>
  <body>
  	<form id="winForm">
		<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%" style="margin-left: 10px">
			<tr height="40px">
				<td width="120px" align="right"><span style="color: red;">*</span>角色名称：</td>
				<td width="140px"><input id="name" name="name" type="text" class="textbox" style="width: 140px;"/></td>
				<td width="80px" align="right">创建人：</td>
				<td width="140px"><input name="create_user" type="text" class="textbox" style="width: 140px;color: blue;" value="${currentUserName }" readonly/></td>
			</tr>
			<tr height="40px" valign="top">
				<td width="120px" align="right">角色描述：</td>
				<td colspan="3">
					<textarea name="notes" rows="8" cols="46"></textarea>
				</td>
			</tr>
	  	</table>
  	</form>
  </body>
</html>
